from api.department_api import DepartmentApi
from common.token_util import TokenUtil


class DepId:
  # @classmethod
  # def get_dep_id(cls):
  #   token = TokenUtil.get_token()
  #   resp=DepartmentApi.organ_list_api(token)
  #   temp=resp.json().get("data").get("depts")
  #   dep_id=temp[0].get("id")
  #   return dep_id
  @classmethod
  def get_dep_id(cls):
    token = TokenUtil.get_token()
    add_dep_body = {"name": "营销", "code": "DEPT-y"}
    resp = DepartmentApi.add_dep_api(token,add_dep_body)
    id=resp.json().get("data").get("id")
    return id

if __name__ == '__main__':
  print(DepId.get_dep_id())
